package com.bocloud.cmp.interfaces.resource;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Room;
import com.bocloud.cmp.model.RoomBean;
import com.bocloud.common.model.BsmResult;
import com.bocloud.common.model.Param;

/**
 * 机房抽象Service接口
 * 
 * @author wei wei
 * @version 1.0
 * @since 2016.02.27
 */
public interface RoomService {

	/**
	 * 添加机房
	 * 
	 * @param room
	 *            the room
	 * @return the result
	 */
	public BsmResult create(Room room, Long userId);

	/**
	 * 更新机房
	 * 
	 * @param bean
	 *            the room bean
	 * @param userId
	 *            the user id
	 * @return the result
	 */
	public BsmResult modify(RoomBean bean, Long userId);

	/**
	 * 逻辑删除机房
	 * 
	 * @param id
	 *            the id
	 * @param id
	 *            the user id
	 * @return the result
	 */
	public BsmResult remove(Long id, Long userId);

	/**
	 * 查询机房详细
	 * 
	 * @param id
	 *            the id
	 * @return the result
	 */
	public BsmResult basic(Long id);

	/**
	 * 查询机房列表
	 * 
	 * @param page
	 *            the page
	 * @param rows
	 *            the rows
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @param simple
	 *            the simple
	 * @return the result
	 */
	public BsmResult list(int page, int rows, List<Param> params, Map<String, String> sorter, Boolean simple);

	/**
	 * 得到当前机房下的机柜列表
	 * 
	 * @param page
	 *            the page
	 * @param rows
	 *            the rows
	 * @param params
	 *            the params
	 * @param sorter
	 *            the sorter
	 * @return the result
	 */
	public BsmResult listRacks(int page, int rows, List<Param> params, Map<String, String> sorter);

	/**
	 * 得到当前机房的基本信息和统计信息
	 * 
	 * @param id
	 *            the id
	 * @return the result
	 */
	public BsmResult detail(Long id);

	/**
	 * 加入数据中心
	 * 
	 * @param id
	 *            the room id
	 * @param dcId
	 *            the dataCenter id
	 * @param userId
	 *            the user id
	 * @return the result
	 */
	public BsmResult inDC(Long id, Long dcId, Long userId);

	/**
	 * 移出数据中心
	 * 
	 * @param id
	 *            the room id
	 * @param userId
	 *            the user id
	 * @return the result
	 */
	public BsmResult outDC(Long id, Long userId);

	/**
	 * 查询空闲机房列表
	 * 
	 * @return the room list
	 */
	public BsmResult freeRooms();

	/**
	 * 检查机柜位置是否被使用
	 * 
	 * @param id
	 *            the id
	 * @param axisX
	 *            the axisX
	 * @param axisY
	 *            the axisY
	 * @return the result
	 */
	public BsmResult checkPoint(Long id, Integer axisX, Integer axisY);

	/**
	 * 机房下没有分配的服务器
	 * 
	 * @param id
	 *            the id
	 * @return the result
	 */
	public BsmResult freeNodes(Long id);

	/**
	 * 机房下没有分配的服务器
	 * 
	 * @param id
	 *            the id
	 * @return the result
	 */
	public BsmResult freeManagers(Long id);
}
